const Promise1 = require('./');
// const Promise1 = Promise;

const TestPromise = Promise1;

var dummy = { dummy: 'dummy' };

const deferred = () => {
  const deferred = {};

  deferred.promise = new TestPromise((resolve, reject) => {
    deferred.resolve = resolve;
    deferred.reject = reject;
  });
  return deferred;
};
TestPromise.deferred = deferred;

var d = deferred();
var isFulfilled = false;

d.promise.then(function onFulfilled() {
  console.log(isFulfilled === true);
});

setTimeout(function () {
  d.resolve(dummy);
  isFulfilled = true;
}, 50);
